package com.dongdongshop.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdongshop.mapper.TbContentCategoryMapper;
import com.dongdongshop.pojo.content.TbContentCategory;
import com.dongdongshop.service.content.ContentCategoryService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Service
@Component
public class ContentCategoryServiceImpl implements ContentCategoryService {

    @Resource
    private TbContentCategoryMapper contentCategoryMapper;

    /*
    * 查询所有广告类型
    * */
    @Override
    public List<TbContentCategory> findContentCategoryAll() {
        return contentCategoryMapper.selectByExample(null);
    }

    /*
    * 增加广告分类
    * */
    @Override
    public void addContentCategory(TbContentCategory cc) {
        contentCategoryMapper.addContentCategory(cc);
    }

    /*
    * 修改广告分类
    * */
    @Override
    public void updateContentCategoryById(TbContentCategory cc) {
        contentCategoryMapper.updateByPrimaryKeySelective(cc);
    }
}
